<template>
    <div class="container">
        <van-nav-bar safe-area-inset-top title="所有app-h5项目入口" />
        <div class="content">
            <div class="list">
                <div v-for="(item, index) in projectList" :key="item + index" @click="goPageHub(item)">
                    <van-button type="primary">农资交易大厅</van-button>

                </div>
            </div>
        </div>
    </div>
</template>

<script>
import projectList from "@/common/projectList";

export default {
    name: "pageHome",
    data() {
        return {
            projectList: projectList.data,
        };
    },
    created() {},
    methods: {
        goPageHub(val) {
            console.log(val);
            let goUrl = `${window.location.protocol}//${window.location.host}/${window.location.hash}`;
            if (val) {
                goUrl = `${goUrl}pageHub?action=${val.pageActive}`;
            }
            console.log(goUrl);
            window.location.href = goUrl;
        },
    },
};
</script>

<style lang="less" scoped>
.container {
    width: 100%;
    .content {
        width: 100%;
        padding-top: 50px;
        box-sizing: border-box;
        .list {
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
        }
    }
}
</style>
